home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / rss / spawnvp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  534 b   |  40 lines

  1. #ifndef MSDOS
  2.  
  3. #include <stdarg.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include "icrss.h"
  8.  
  9. int _spawnvp (int mode, const char *prog, const char **av)
  10. {
  11.     char
  12.         buf [_MAX_PATH * 4];
  13.  
  14.     strcpy (buf, prog);
  15.     av++;
  16.  
  17.     while (*av)
  18.     {
  19.         strcat (buf, " ");
  20.         strcat (buf, *av);
  21.         av++;
  22.     }
  23.  
  24.     return (system (buf));
  25. }
  26.  
  27. #ifdef DEBUG
  28. int main ()
  29. {
  30.     static char
  31.         *args [] = { "ls", "*.c", "*.h", NULL };
  32.  
  33.     _spawnvp (0, "ls", (const char **) args);
  34.  
  35.     return (0);
  36. }
  37. #endif
  38.  
  39. #endif
  40.